package com.yjc.hire.config;

import com.yjc.hire.intercept.SMSIntercept;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * <p>
 *
 * @author jcyin
 * @since 2025/7/3
 * </p>
 */

@Configuration
public class InterceptConfig implements WebMvcConfigurer {

    @Bean
    public SMSIntercept smsIntercept() {
        return new SMSIntercept();
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(smsIntercept())
                .addPathPatterns("/passport/getSMSCogit");
    }
}
